LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_FULL_MANIFEST_FILE := $(LOCAL_PATH)/AndroidManifest.xml
LOCAL_MODULE_TAGS := optional

ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 28 && echo OK), OK)
	LOCAL_PRIVATE_PLATFORM_APIS := true
endif

LOCAL_SRC_FILES := $(call all-subdir-java-files)

LOCAL_STATIC_JAVA_LIBRARIES := zxing-core \
	umapps-common\
	um-cpu-chart \
    um-cpu-monitor \
    android-support-v4 \



LOCAL_RESOURCE_DIR :=  $(LOCAL_PATH)/res

########## link project app ##########
PROJECT_APP_PATH := $(LOCAL_PATH)/../../../../../project/$(PRODUCT_USER)/$(PROJECT_NAME)/apps/UMSystemMonitor
$(warning PRODUCT_USER=$(PRODUCT_USER),PROJECT_NAME=$(PROJECT_NAME),PROJECT_APP_PATH=$(PROJECT_APP_PATH))
ifeq ("$(wildcard $(PROJECT_APP_PATH))","")
    $(warning $(PROJECT_APP_PATH) not exists.)

else
    $(warning $(PROJECT_APP_PATH) exits.)
    PROJECT_APP_SRC_PATH := ../../../../../project/$(PRODUCT_USER)/$(PROJECT_NAME)/apps/UMSystemMonitor/src
    LOCAL_SRC_FILES += \
        $(call all-java-files-under, $(PROJECT_APP_SRC_PATH))
    LOCAL_RESOURCE_DIR += \
        $(PROJECT_APP_PATH)/res \
        $(LOCAL_PATH)/res
    LOCAL_FULL_LIBS_MANIFEST_FILES := \
        $(PROJECT_APP_PATH)/AndroidManifest.xml
    LOCAL_AAPT_FLAGS += --auto-add-overlay
endif
###########

LOCAL_PACKAGE_NAME := UMSystemMonitor2
LOCAL_CERTIFICATE := platform
LOCAL_PROGUARD_ENABLED := disabled
#LOCAL_PROGUARD_FLAG_FILES := proguard.cfg

LOCAL_DEX_PREOPT := false

include $(BUILD_PACKAGE)


include $(CLEAR_VARS)
LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := \
    zxing-core:libs/zxing-core-2.0.jar
include $(BUILD_MULTI_PREBUILT)
